home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / menubutton.n < prev    next >
Text File  |  1995-07-25  |  17KB  |  264 lines

  1.  
  2.  
  3.  
  4.      mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))                TTTTkkkk (((( ))))                 mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           menubutton - Create and manipulate menubutton widgets
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  15.  
  16.      SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  17.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               bbbbiiiittttmmmmaaaapppp          ffffoooonnnnttttrrrreeeelllliiiieeeeffff     |
  18.           aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd               bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh     ffffoooorrrreeeeggggrrrroooouuuunnnnddddtttteeeexxxxtttt |
  19.           aaaannnncccchhhhoooorrrr          ccccuuuurrrrssssoooorrrr         ppppaaaaddddXXXX            tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee   |
  20.           bbbbaaaacccckkkkggggrrrroooouuuunnnndddd      ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd             ppppaaaaddddYYYYuuuunnnnddddeeeerrrrlllliiiinnnneeee  |
  21.  
  22.           See the ``options'' manual entry for details on the standard
  23.           options.
  24.  
  25.      WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  26.           Name:           hhhheeeeiiiigggghhhhtttt                                        |
  27.           Class:          HHHHeeeeiiiigggghhhhtttt                                        |
  28.           Command-Line Switch:----hhhheeeeiiiigggghhhhtttt                                   |
  29.  
  30.                                                                              ||
  31.                Specifies  a  desired height for the menu button.  If a  |
  32.                bitmap is being displayed in the menu button  then  the  |
  33.                value  is  in  screen  units  (i.e.  any  of  the forms  |
  34.                acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is in lines of  |
  35.                text.    If  this  option  isn't  specified,  the  menu  |
  36.                button's desired height is computed from  the  size  of  |
  37.                the bitmap or text being displayed in it.
  38.  
  39.           Name:           mmmmeeeennnnuuuu
  40.           Class:          MMMMeeeennnnuuuuNNNNaaaammmmeeee
  41.           Command-Line Switch:----mmmmeeeennnnuuuu
  42.  
  43.                Specifies the path name of  the  menu  associated  with
  44.                this  menubutton.  The menu must be a descendant of the  |
  45.                menubutton in order for normal pull-down  operation  to  |
  46.                work via the mouse.
  47.  
  48.           Name:           ssssttttaaaatttteeee
  49.           Class:          SSSSttttaaaatttteeee
  50.           Command-Line Switch:----ssssttttaaaatttteeee
  51.  
  52.                Specifies one of three  states  for  the  menu  button:
  53.                nnnnoooorrrrmmmmaaaallll,  aaaaccccttttiiiivvvveeee, or ddddiiiissssaaaabbbblllleeeedddd.  In normal state the menu
  54.                button is displayed using the ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd
  55.                options.   The  active state is typically used when the
  56.                pointer is over the menu button.  In active  state  the
  57.                menu button is displayed using the aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and
  58.                aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd options.  Disabled  state  means  that
  59.                the  menu  button  is insensitive:  it doesn't activate
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))                TTTTkkkk (((( ))))                 mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))
  71.  
  72.  
  73.  
  74.                and doesn't respond to mouse button presses.   In  this
  75.                state  the  ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  and  bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options
  76.                determine how the button is displayed.
  77.  
  78.           Name:           wwwwiiiiddddtttthhhh                                         |
  79.           Class:          WWWWiiiiddddtttthhhh                                         |
  80.           Command-Line Switch:----wwwwiiiiddddtttthhhh                                    |
  81.  
  82.                                                                              ||
  83.                Specifies  a  desired  width for the menu button.  If a  |
  84.                bitmap is being displayed in the menu button  then  the  |
  85.                value  is  in  screen  units  (i.e.  any  of  the forms  |
  86.                acceptable  to  TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss);  for  text  it   is   in  |
  87.                characters.   If  this option isn't specified, the menu  |
  88.                button's desired width is computed from the size of the  |
  89.                bitmap or text being displayed in it.
  90.      _________________________________________________________________
  91.  
  92.  
  93.      IIIINNNNTTTTRRRROOOODDDDUUUUCCCCTTTTIIIIOOOONNNN
  94.           The mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command creates a new window  (given  by  the
  95.           _p_a_t_h_N_a_m_e  argument)  and  makes it into a menubutton widget.
  96.           Additional options, described above, may be specified on the
  97.           command  line or in the option database to configure aspects
  98.           of the menubutton  such  as  its  colors,  font,  text,  and
  99.           initial relief.  The mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command returns its _p_a_t_h_N_a_m_e
  100.           argument.  At the time this command is invoked,  there  must
  101.           not  exist  a  window  named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent
  102.           must exist.
  103.  
  104.           A menubutton is a widget that displays a textual  string  or  |
  105.           bitmap  and  is  associated  with  a menu widget.  In normal
  106.           usage, pressing mouse button 1 over  the  menubutton  causes
  107.           the  associated  menu  to  be  posted  just  underneath  the
  108.           menubutton.  If the mouse is  moved  over  the  menu  before
  109.           releasing  the  mouse  button, the button release causes the
  110.           underlying menu entry to be invoked.   When  the  button  is
  111.           released, the menu is unposted.
  112.  
  113.           Menubuttons are typically organized into groups called  menu  |
  114.           bars  that  allow  scanning:  if the mouse button is pressed  |
  115.           over one menubutton (causing it to post its  menu)  and  the  |
  116.           mouse  is moved over another menubutton in the same menu bar  |
  117.           without releasing the mouse button, then  the  menu  of  the  |
  118.           first  menubutton  is  unposted  and  the  menu  of  the new  |
  119.           menubutton is posted instead.  The ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr  procedure  is  |
  120.           used  to  set  up menu bars for scanning; see that procedure  |
  121.           for more details.
  122.  
  123.  
  124.      WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  125.           The mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command creates a new Tcl command whose  name
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/23/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))                TTTTkkkk (((( ))))                 mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))
  137.  
  138.  
  139.  
  140.           is  _p_a_t_h_N_a_m_e.   This  command  may be used to invoke various
  141.           operations on the widget.   It  has  the  following  general
  142.           form:
  143.  
  144.                _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  145.           _O_p_t_i_o_n and the _a_r_gs determine  the  exact  behavior  of  the
  146.           command.  The following commands are possible for menubutton
  147.           widgets:
  148.  
  149.           _p_a_t_h_N_a_m_e aaaaccccttttiiiivvvvaaaatttteeee
  150.                Change the menu button's state to aaaaccccttttiiiivvvveeee and  redisplay
  151.                the   menu  button  using  its  active  foreground  and
  152.                background  colors  instead  of  normal  colors.    The
  153.                command  returns  an  empty  string.   This  command is  |
  154.                ignored if the menu button's state is  ddddiiiissssaaaabbbblllleeeedddd.   This  |
  155.                command is obsolete and will eventually be removed; use  |
  156.                ``_p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ----ssssttttaaaatttteeee aaaaccccttttiiiivvvveeee'' instead.
  157.  
  158.           _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  159.                Query  or  modify  the  configuration  options  of  the
  160.                widget.   If  no  _o_p_t_i_o_n  is  specified, returns a list
  161.                describing all of the available  options  for  _p_a_t_h_N_a_m_e
  162.                (see  TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of
  163.                this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  164.                the  command  returns  a  list describing the one named
  165.                option  (this   list   will   be   identical   to   the
  166.                corresponding  sublist  of  the  value  returned  if no
  167.                _o_p_t_i_o_n is specified).   If  one  or  more  _o_p_t_i_o_n-_v_a_l_u_e
  168.                pairs  are  specified,  then  the  command modifies the
  169.                given widget option(s) to have the given value(s);   in
  170.                this  case the command returns an empty string.  _O_p_t_i_o_n
  171.                may have any of the values accepted by  the  mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn
  172.                command.
  173.  
  174.           _p_a_t_h_N_a_m_e ddddeeeeaaaaccccttttiiiivvvvaaaatttteeee
  175.                Change the menu button's state to nnnnoooorrrrmmmmaaaallll and  redisplay
  176.                the   menu  button  using  its  normal  foreground  and
  177.                background  colors.   The  command  returns  an   empty
  178.                string.   This  command is ignored if the menu button's  |
  179.                state is ddddiiiissssaaaabbbblllleeeedddd.  This command is obsolete  and  will  |
  180.                eventually  be removed; use ``_p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ----ssssttttaaaatttteeee  |
  181.                nnnnoooorrrrmmmmaaaallll'' instead.
  182.  
  183.  
  184.      DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  185.           Tk automatically creates class  bindings  for  menu  buttons  |
  186.           that give them the following default behavior:                |
  187.  
  188.           [1]                                                                ||
  189.                A  menu button activates whenever the mouse passes over  |
  190.                it and deactivates whenever the mouse leaves it.         |
  191.  
  192.  
  193.      Page 3                                          (printed 7/23/95)
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.      mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))                TTTTkkkk (((( ))))                 mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((nnnn))))
  201.  
  202.  
  203.  
  204.           [2]                                                                ||
  205.                A  menu  button's  relief is changed to raised whenever  |
  206.                mouse button 1 is pressed over it, and  the  relief  is  |
  207.                restored  to  its original value when button 1 is later  |
  208.                released or the mouse  is  dragged  into  another  menu  |
  209.                button in the same menu bar.                             |
  210.  
  211.           [3]                                                                ||
  212.                When  mouse  button 1 is pressed over a menu button, or  |
  213.                when the mouse is dragged into a menu button with mouse  |
  214.                button  1  pressed, the associated menu is posted;  the  |
  215.                mouse can be dragged across the menu and released  over  |
  216.                an entry in the menu to invoke that entry.  The menu is  |
  217.                unposted when button 1 is released outside  either  the  |
  218.                menu  or  the  menu  button.  The menu is also unposted  |
  219.                when the mouse is dragged into another menu  button  in  |
  220.                the same menu bar.                                       |
  221.  
  222.           [4]                                                                ||
  223.                If  mouse  button  1 is pressed and released within the  |
  224.                menu button, then the menu stays  posted  and  keyboard  |
  225.                traversal  is possible as described in the manual entry  |
  226.                for ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr.                                          |
  227.  
  228.           [5]                                                                ||
  229.                Menubuttons  may also be posted by typing characters on  |
  230.                the keyboard.  See the manual entry for ttttkkkk____mmmmeeeennnnuuuuBBBBaaaarrrr  for  |
  231.                full details on keyboard menu traversal.                 |
  232.  
  233.           [6]                                                                ||
  234.                If  mouse  button  2 is pressed over a menu button then  |
  235.                the associated menu is posted and also  _t_o_r_n  _o_f_f:   it  |
  236.                can  then be dragged around on the screen with button 2  |
  237.                and the menu will not automatically unpost when entries  |
  238.                in  it  are  invoked.   To close a torn off menu, click  |
  239.                mouse button 1 over the associated menu button.          |
  240.  
  241.           If the menu button's state is  ddddiiiissssaaaabbbblllleeeedddd  then  none  of  the  |
  242.           above  actions  occur:   the  menu button is completely non-  |
  243.           responsive.                                                   |
  244.  
  245.           The behavior of menu buttons can be changed by defining  new  |
  246.           bindings  for  individual widgets or by redefining the class  |
  247.           bindings.
  248.  
  249.  
  250.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  251.           menubutton, widget
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.      Page 4                                          (printed 7/23/95)
  260.  
  261.  
  262.  
  263.